home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK2.toast / Development Kits (Disc 2) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Extensions… / Confidential ƒ / Confidential.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-20  |  2.6 KB  |  80 lines  |  [TEXT/MPS ]

  1. /*________________________________________________________
  2.  
  3.     File: Confidential.h
  4.     
  5.     Header file for a printing extension that stamps a
  6.     message on each page spooled.
  7.  
  8.     Dave Hersey
  9.     Apple Developer Technical Support
  10.  
  11.     2/01/93  - dmh - Completely rewrote for the a5 seed.
  12.     4/26/93  - dmh - Renamed files for b1 seed.
  13.     4/27/93  - dmh - Updated NewSpoolPage override to work
  14.                      w/o CopyDeepToShape.
  15.     9/05/93  - dmh - Updated for b2.
  16.              - removed work-around for a 1.0a5
  17.                panel bug.  That should have been
  18.                removed in the b1 version…  oops.
  19.              - Fixed minor bug with panel's editText
  20.                fields' highlighting.
  21.              - Switched to Exception.h assertion stuff
  22.                for error checking.
  23.    12/18/93  - dmh - Updated for b3.
  24.     3/22/94  - dmh - Updated for b4.
  25.  
  26.     (Note: there are labels in the Mark menu.)
  27.  
  28. __________________________________________________________*/
  29.  
  30. #include <Types.h>
  31. #include <Errors.h>
  32. #include <Resources.h>
  33. #include <Packages.h>
  34. #include <ToolUtils.h>
  35.  
  36. #pragma pointers_in_D0
  37. #include <GXExceptions.h>
  38. #include <GXMessages.h>
  39. #include <GXPrinterDrivers.h>
  40. #include <GXPrinting.h>
  41. #include <GXGraphics.h>
  42. #include <GXMath.h>
  43.  
  44.  
  45. #define kCreator                'CON!'        /* Our app's creator type.                */
  46. #define kStampCollectionType    kCreator    /* The only collection type we use.        */
  47.  
  48. #define r_str                    200            /* ID of STR# resource.                    */
  49. #define r_defaultStrIdx            1            /* index of default text string.         */
  50. #define r_defaultFSizeIdx        2            /* index of default font size string.     */
  51.  
  52. #define r_stampPanel            2000        /* Our panel ID.                        */
  53. #define d_message                5            /* DITL item for our message field.        */
  54. #define d_fontSize                7            /* DITL item for our font size field.    */
  55.  
  56.  
  57. // This is what our stamp information collection looks like.  Remember: the
  58. // offsets for the fields below must match those in the xdtl resource exactly.
  59.  
  60. typedef struct StampCollection
  61. {                                    // offset:
  62.     unsigned char    stampEnabled;    //   0        stamp is on/off.
  63.     char            fillByte;        //          unused. C requires for alignment.
  64.     long            fontSize;        //     2        font size to use.
  65.     Str63            message;        //     6        message to print.
  66. } StampCollection;
  67.  
  68.  
  69. // Prototypes follow
  70.  
  71. OSErr        NewJobPrintDialog(gxDialogResult *dlogResult);
  72. OSErr        NewHandlePanelEvent(gxPanelInfoRecord *panelInfo);
  73. OSErr        NewSpoolPage(gxSpoolFile spFile, gxFormat aFormat, gxShape originalPage);
  74. OSErr        AddStampToPage(StampCollection *stampConfig, gxShape pgShape, gxFormat aFormat);
  75. OSErr        SetUpPrintPanel(void);
  76. OSErr        GetDefaultSettings(StampCollection *stampConfig);
  77. OSErr        GetStamp(StampCollection *stampConfig);
  78. OSErr        GetJobCollectionItem(void *collectItem, long *collectSize,
  79.                                  OSType collectType, short collectID);
  80.